<template>
	<view v-if="loaded" class="cat2bug-body">
		<page-header :team-id="teamId" :disabled="false" :show-back-button="false"></page-header>
		<page-body>
			<template v-slot:content>
				<view class="col full-width">
					<uni-section :title="$t('project.manage')" type="line">
						<!-- 宫格组件 -->
						<view class="grid-body">
						  <uni-grid :column="4" :showBorder="false" @change="changeGrid">
							<uni-grid-item v-for="(pml, pmlIndex) in projectManagerList" :index="pmlIndex" :key="pmlIndex">
								<view class="grid-item-box">
									<uni-icons :type="pml.icon" size="30"></uni-icons>
									<text class="text">{{ $t(pml.label) }}</text>
								</view>
							</uni-grid-item>
						  </uni-grid>
						</view>
					</uni-section>
					<uni-section :title="$t('project.option')" type="line">
						<!-- 宫格组件 -->
						<view class="grid-body">
						  <uni-grid :column="4" :showBorder="false" @change="changeGrid">
							<uni-grid-item>
								<view class="grid-item-box">
									<uni-icons type="list" size="30"></uni-icons>
									<text class="text">项目信息</text>
								</view>
							</uni-grid-item>
							<uni-grid-item>
								<view class="grid-item-box">
									<uni-icons type="link" size="30"></uni-icons>
									<text class="text">API KEY</text>
								</view>
							</uni-grid-item>
							<uni-grid-item>
								<view class="grid-item-box">
									<uni-icons type="person-filled" size="30"></uni-icons>
									<text class="text">成员管理</text>
								</view>
							</uni-grid-item>
						  </uni-grid>
						</view>
					</uni-section>
					<uni-section :title="$t('team.option')" type="line">
						<!-- 宫格组件 -->
						<view class="grid-body">
							<uni-grid :column="4" :showBorder="false" @change="changeGrid">
								<uni-grid-item>
									<view class="grid-item-box">
										<uni-icons type="settings-filled" size="30"></uni-icons>
										<text class="text">团队信息</text>
									</view>
								</uni-grid-item>
								<uni-grid-item>
									<view class="grid-item-box">
										<uni-icons type="person-filled" size="30"></uni-icons>
										<text class="text">成员管理</text>
									</view>
								</uni-grid-item>
							</uni-grid>
						</view>
					</uni-section>
				</view>
			</template>
		</page-body>
	</view>
  <!-- <view class="work-container">
    
    <uni-swiper-dot class="uni-swiper-dot-box" :info="data" :current="current" field="content">
      <swiper class="swiper-box" :current="swiperDotIndex" @change="changeSwiper">
        <swiper-item v-for="(item, index) in data" :key="index">
          <view class="swiper-item" @click="clickBannerItem(item)">
            <image :src="item.image" mode="aspectFill" :draggable="false" />
          </view>
        </swiper-item>
      </swiper>
    </uni-swiper-dot>

    
    
  </view> -->
</template>

<script>
  export default {
    data() {
      return {
        current: 0,
        swiperDotIndex: 0,
        data: [{
            image: '/static/images/banner/banner01.jpg'
          },
          {
            image: '/static/images/banner/banner02.jpg'
          },
          {
            image: '/static/images/banner/banner03.jpg'
          }
        ],
		projectManagerList:[{
			label: 'project.project-list',
			icon: 'list'
		},{
			label: 'case',
			icon: 'smallcircle'
		},{
			label: 'plan',
			icon: 'settings-filled'
		},{
			label: 'defect.manage',
			icon: 'fire-filled'
		},{
			label: 'module',
			icon: 'map-filled'
		},{
			label: 'report',
			icon: 'medal-filled'
		},{
			label: 'doc',
			icon: 'folder-add-filled'
		}]
      }
    },
	computed: {
		/** 是否加载完成  */
		loaded() {
			return (this.$i18n && this.$i18n.locale)?true:false;
		},
	},
    methods: {
      clickBannerItem(item) {
        console.info(item)
      },
      changeSwiper(e) {
        this.current = e.detail.current
      },
      changeGrid(e) {
		  switch(e.detail.index) {
			  case 0:
				this.$tab.navigateTo('/subpackage/pages/system/project/index');
				break;
			  case 3:
				this.$tab.switchTab('/pages/system/defect/index')
				break;
			  case 4:
				this.$tab.navigateTo('/subpackage/pages/system/module/index');
				break;
			  default:
				this.$modal.showToast('模块建设中~');
				break;
		  }
      }
    }
  }
</script>

<style lang="scss" scoped>
  /* #ifndef APP-NVUE */
  page {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    background-color: #fff;
    min-height: 100%;
    height: auto;
  }

  view {
    font-size: 14px;
    line-height: inherit;
  }
  /* #endif */

  .text {
    text-align: center;
    font-size: 26rpx;
    margin-top: 10rpx;
  }

  .grid-item-box {
    flex: 1;
    /* #ifndef APP-NVUE */
    display: flex;
    /* #endif */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px 0;
  }

  .uni-margin-wrap {
    width: 690rpx;
    width: 100%;
    ;
  }

  .swiper {
    height: 300rpx;
  }

  .swiper-box {
    height: 150px;
  }

  .swiper-item {
    /* #ifndef APP-NVUE */
    display: flex;
    /* #endif */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #fff;
    height: 300rpx;
    line-height: 300rpx;
  }

  @media screen and (min-width: 500px) {
    .uni-swiper-dot-box {
      width: 400px;
      /* #ifndef APP-NVUE */
      margin: 0 auto;
      /* #endif */
      margin-top: 8px;
    }

    .image {
      width: 100%;
    }
  }
</style>
